// import { adverseUpdate } from './../work/index';
import request from '@/utils/axios'
import store from '@/store'

// 用户列表
export const getUserList = () => {
  return request.get({
    url: '/sys/user/doctor',
    params: {
      orgId: store.userStore.orgId
    }
  })
}

// 管理医生
export const getDoctorList = (data: any) => {
  return request.get({
    url: '/disease/manage/info/list-manager',
    params: data
  })
}

// 医生列表
export const userDoctorList = (data: any) => {
  return request.get({
    url: '/disease/user/doctor',
    params: data
  })
}

// 根据用户获取分组数据
export const getListByUser = () => {
  return request.get({
    url: '/disease/manage/group/list-all'
    // url: '/disease/manage/group/list-by-user',
    // params: {
    //   userId: store.userApp.userInfo.id
    // }
  })
}

// 患者管理列表
export const getPatientList = (data: any) => {
  return request.post({
    url: '/disease/manage/info/page',
    data: data
  })
}

// 我的收藏
export const getMyFavorite = (data: any) => {
  return request.post({
    url: '/disease/manage/info/list-my-favorite',
    data: data
  })
}

// 获取未分配患者
export const getUnsetList = (data: any) => {
  return request.get({
    url: '/disease/manage/info/list-unset-by-group',
    params: data
  })
}

// 批量分配
export const batchSet = (data: any) => {
  return request.post({
    url: '/disease/manage/info/batch-set',
    data: data
  })
}

// 根据患者姓名或就诊号检索
export const getByName = (data: any) => {
  return request.get({
    url: '/disease/manage/patient/get-by-name',
    params: data
  })
}

// 新增患者入组
export const addPatient = (data: any) => {
  return request.post({
    url: '/disease/manage/info/save-batch',
    data: data
  })
}

// 收藏
export const addFavorite = (data: any) => {
  return request.get({
    url: '/disease/manage/info/favorite',
    params: data
  })
}

// 取消收藏
export const cancelFavorite = (data: any) => {
  return request.get({
    url: '/disease/manage/info/cancel-favorite',
    params: data
  })
}

// 诊疗事件时间轴
export const getTreatLine = (data: any) => {
  return request.get({
    url: '/disease/manage/patient/treat-line',
    params: data
  })
}

// 管理信息详情
export const getInfoDetail = (data: any) => {
  return request.get({
    url: '/disease/manage/info/get',
    params: data
  })
}

//删除
export const deleteInfo = (data: any) => {
  return request.post({
    url: '/disease/manage/info/delete',
    data: data
  })
}

// 模板列表
export const getTemplateList = (data: any) => {
  return request.post({
    url: '/disease/template/page',
    data: data
  })
}

// 管理活动记录
export const getManageRecord = (data: any) => {
  return request.get({
    url: '/disease/manage/patient/list-manage-log',
    params: data
  })
}

// 操作记录
export const getOperationRecord = (data: any) => {
  return request.get({
    url: '/disease/manage/patient/list-operation-log',
    params: data
  })
}

// 手动管理
export const manualManage = (data: any) => {
  return request.post({
    url: '/disease/manage/info/hand-run',
    data: data
  })
}

// 新增模板表单
export const saveTemplateForm = (data: any) => {
  return request.post({
    url: '/disease/template/save',
    data: data
  })
}

// 不良事件详情
export const adverseDetail = (data: any) => {
  return request.get({
    url: '/disease/station/adverse/detail',
    params: data
  })
}

// 发送提醒
export const sendMsg = (data: any) => {
  return request.post({
    url: '/disease/station/adverse/send-msg',
    data: data
  })
}

// 不良事件修改(忽略)
export const adverseUpdates = (data: any) => {
  return request.post({
    url: '/disease/station/adverse/update',
    data: data
  })
}

// 复查详情
export const remindDetail = (data: any) => {
  return request.post({
    url: '/disease/station/remind/detail',
    data: data
  })
}

// 复查修改（完成）
export const remindFinished = (data: any) => {
  return request.post({
    url: '/disease/station/remind/finished',
    data: data
  })
}

// 复查修改（忽略）
export const remindUpdates = (data: any) => {
  return request.post({
    url: '/disease/station/remind/update',
    data: data
  })
}

// 随访任务详情
export const followDetail = (data: any) => {
  return request.get({
    url: '/disease/station/follow/detail',
    data: data
  })
}

// 随访任务详情
export const templateListAll = (data: any) => {
  return request.get({
    //   url: '/disease/station/template/list-all',
    url: '/disease/template/list-all',
    params: data
  })
}

// 创建随访任务
export const followSave = (data: any) => {
  return request.post({
    url: '/disease/station/follow/save',
    data: data
  })
}

// 工作台-随访信息-随访任务修改(忽略)
export const followUpdate = (data: any) => {
  return request.post({
    url: '/disease/station/follow/update',
    data: data
  })
}

// 获取患者最新的随访任务
export const followTopOne = (data: any) => {
  return request.post({
    url: '/disease/station/follow/top-one',
    data: data
  })
}
// 获取当前患者的最新的不良反应
export const adverseTopOne = (data: any) => {
  return request.post({
    url: '/disease/station/adverse/top-one',
    data: data
  })
}
// 获取当前患者的最新为复查提醒
export const remindTopOne = (data: any) => {
  return request.post({
    url: '/disease/station/remind/top-one',
    data: data
  })
}
